<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>编辑图书</title>
	<jsp:include page="/pages/common/head.jsp"></jsp:include>

<style type="text/css">
	h1 {
		text-align: center;
		margin-top: 200px;
	}
	
	h1 a {
		color:red;
	}
	
	input {
		text-align: center;
	}

	#main .submitBtn{
		display: inline-block;
		padding: 5px 6px;
		background-color: #409eff;
		transition: 0.1s;
		font-size: 17px;
		color: #fff;
		text-decoration: none;
		border-radius: 3px;
		border: none;
	}

	#main .submitBtn:hover{
		background-color: #66b1ff;
	}
</style>

<script>
	$(function (){
		$(".submitBtn").click(function (){
			const username = $("#main table input").eq(0);
			const password = $("#main table input").eq(1);
			const email = $("#main table input").eq(2);

			if(username.value === ""){
				alert('用户名不允许为空');
				return false;
			}

			if(password.value === ""){
				alert('密码不允许为空');
				return false;
			}

			if(email.value === ""){
				alert('email不允许为空');
				return false;
			}
		})
	})
</script>

</head>
<body>
		<div id="header">

			<span class="wel_word">编辑用户</span>
			<%@include file="/pages/common/manager_menu.jsp"%>

		</div>

		<div id="main">
			<form action="userServlet" method="get">
				<input type="hidden" name="action" value="update">
				<input type="hidden" name="pageNo" value="${param.pageNo}">
				<input type="hidden" name="id" value="${requestScope.user.id}">
				<table>
					<tr>
						<td>用户名</td>
						<td>密码</td>
						<td>邮箱</td>
						<td>操作</td>
					</tr>		
					<tr>
						<td><input name="username" type="text" value="${requestScope.user.username}" style="width: 70px"/></td>
						<td><input name="password" type="text" value="${requestScope.user.password}"/></td>
						<td><input name="email" type="text" value="${requestScope.user.email}"/></td>
						<td><input class="submitBtn" type="submit" value="提交"/></td>
					</tr>	
				</table>
			</form>
			
	
		</div>

		<%--静态包含页脚内容--%>
		<%@include file="/pages/common/foot.jsp"%>
</body>
</html>